import java.util.Scanner;
public class Rational {
  private int v1;
  private int v2;
  public Rational(int v1,int v2){
	  this.v1=v1;
	  this.v2=v2;
  }
  private int gcd(int a,int b){
	  int a1=Math.abs(a);
	  int b1=Math.abs(b);
	  int gcd;
	  while(a1%b1!=0)
	  {
		  gcd=b1;
		  b1=a1%b1;
		  a1=gcd;
	  }
	  return gcd;
  }
  void Add(Rational m,Rational n){
	  int f1=m.v2*n.v2;
	  int f2=m.v1*n.v2+m.v2*n.v1;
	  f1=f1/gcd(f1,f2);
	  f2=f2/gcd(f1,f2);
	  Rational c=new Rational(f1,f2);
  }
  void Minus(Rational m,Rational n){
	  int f1=m.v2*n.v2;
	  int f2=m.v1*n.v2+m.v2*n.v1;
	  f1=f1/gcd(f1,f2);
	  f2=f2/gcd(f1,f2);
	  Rational c=new Rational(f1,f2);
}
  void Mulify(Rational m,Rational n){
	  int f1=m.v2*n.v2;
	  int f2=m.v1*n.v1;
	  f1=f1/gcd(f1,f2);
	  f2=f2/gcd(f1,f2);
	  Rational c=new Rational(f1,f2);
  }
  void Divite(Rational m,Rational n){
	  int f1=m.v2*n.v1;
	  int f2=m.v1*n.v2;
	  f1=f1/gcd(f1,f2);
	  f2=f2/gcd(f1,f2);
	  Rational c=new Rational(f1,f2);
}
  public static void main(String[] args){
	  Scanner sc=new Scanner(System.in);
	  int a=sc.nextInt();
	  int b=sc.nextInt();
	  Rational yl1=new Rational(a,b);
	  int c=sc.nextInt();
	  int d=sc.nextInt();
	  Rational yl2=new Rational(c,d); 
  }
}